//
//  PKGroupGroupCellModel.m
//  PianKe
//
//  Created by lanou on 15/10/16.
//  Copyright (c) 2015年 李伟伟. All rights reserved.
//

#import "PKGroupGroupCellModel.h"
#import "PKGroupGroupPostModel.h"
@implementation PKGroupGroupCellModel


-(void)setValue:(id)value forKey:(NSString *)key
{
    if ([key isEqualToString:@"userinfo"]) {
        _userinfo = [[PKGroupGroupUserinfoModel alloc]init];
        [_userinfo setValuesForKeysWithDictionary:value];
    }else if ([key isEqualToString:@"latestposts"]){
        
        _postArray = [NSMutableArray arrayWithCapacity:0];
        
        for (NSDictionary *postDic in value) {
            _post = [[PKGroupGroupPostModel alloc]init];
            
            [_post setValuesForKeysWithDictionary:postDic];
            [_postArray addObject:_post];
            
        }
    }else{
        [super setValue:value forKey:key];
    }
}
@end
